package com.isunland.managesystem.adapter;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import com.isunland.managesystem.R;
import com.isunland.managesystem.base.BaseListAdapter;
import com.isunland.managesystem.entity.ProjectCollectOriginal.ProjectCollectContent;
import com.isunland.managesystem.ui.ProjectCountContent;
import java.util.List;

public class ProjectCountListAdapter extends BaseListAdapter<ProjectCollectContent> {

  private ProjectCountContent queryContent;

  public ProjectCountListAdapter(Context context, List<ProjectCollectContent> objects) {
    super(context, objects);
  }

  public ProjectCountListAdapter(Context context, List<ProjectCollectContent> objects,
      ProjectCountContent queryContent) {
    super(context, objects);
    this.queryContent = queryContent;
  }

  @Override
  public void bindData(int position, BaseListAdapter.ViewHolder vh, ProjectCollectContent item) {

    //		vh.mTitleOneTv.setText(R.string.projectName_colon);
    //		vh.mContentOneTv.setText(item.getProjectName());
    //
    //		vh.mTitleTwoTv.setText(R.string.customer_unit_name);
    //		vh.mContentTwoTv.setText(item.getPartaName());
    //
    //		vh.mTitleThreeTv.setText(R.string.stages_name);
    //		vh.mContentThreeTv.setText(item.getStages());
    //
    //		if (TextUtils.isEmpty(queryContent.getPartaName())) {
    //			vh.mHolderTwoVg.setVisibility(View.GONE);
    //		}
    //
    //		if (TextUtils.isEmpty(queryContent.getStages())) {
    //			vh.mHolderThreeVg.setVisibility(View.GONE);
    //		}

    vh.mTitleOneTv.setText(R.string.projectKind_colon);
    if (TextUtils.isEmpty(queryContent.getProjectKindName())) {
      vh.mHolderOneVg.setVisibility(View.GONE);
    } else {
      vh.mContentOneTv.setText(item.getProjectKindName());
    }

    vh.mTitleTwoTv.setText(R.string.project_stages_colon);
    if (TextUtils.isEmpty(queryContent.getStages())) {
      vh.mHolderTwoVg.setVisibility(View.GONE);
    } else {
      vh.mContentTwoTv.setText(item.getStages());
    }

    vh.mTitleThreeTv.setText(R.string.contactPart);
    if (TextUtils.isEmpty(queryContent.getPartaName())) {
      vh.mHolderThreeVg.setVisibility(View.GONE);
    } else {
      vh.mContentThreeTv.setText(item.getPartaName());
    }

    vh.mTitleFourTv.setText(R.string.pmName_colon);
    if (TextUtils.isEmpty(queryContent.getPmName())) {
      vh.mHolderFourVg.setVisibility(View.GONE);
    } else {
      vh.mContentFourTv.setText(item.getPmName());
    }

    vh.mTitleFiveTv.setText(R.string.finish_time_colon);
    if (TextUtils.isEmpty(queryContent.getRequireDate())) {
      vh.mHolderFiveVg.setVisibility(View.GONE);
    } else {
      vh.mContentFiveTv.setText(item.getRequireDate());
    }

    vh.mTitleSixTv.setText(R.string.signDate_colon);
    if (TextUtils.isEmpty(queryContent.getProjectSignDate())) {
      vh.mHolderSixVg.setVisibility(View.GONE);
    } else {
      vh.mContentSixTv.setText(item.getProjectSignDate());
    }

    vh.mTitleSevenTv.setText(R.string.isCheck_colon);
    if (TextUtils.isEmpty(queryContent.getIfAcceptance())) {
      vh.mHolderSevenVg.setVisibility(View.GONE);
    } else {
      if ("F".equals(item.getIfAcceptance())) {
        vh.mContentSevenTv.setText("未验收");
      } else if ("T".equals(item.getIfAcceptance())) {
        vh.mContentSevenTv.setText("已验收");
      }
    }
    vh.mTitleEightTv.setText(R.string.project_num);
    vh.mContentEightTv.setText(item.getRemark());
  }
}
